import request from "../axios/request.js";

//校验用户名是否重复的接口  user/checkUserName
export const registerValidateApi = (username) => {
    return request({
        method: "get",
        url: "/api/user/checkUserName",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded;charset=utf-8",
        },
        params:{
            username:username
        }
    })
}
//用户注册接口
export const registerApi = (userInfo) => {
    return request.post("/api/user/register",userInfo)
}
//用户登录接口
export const loginApi = (loginInfo) => {
    return request.post("/api/user/login",loginInfo)
}

//获取用户数据
export const getUserInfo = () => {
    return request.get("/api/user/getUserInfo")
}
//退出登录
export const loginOutApi = () =>{
    return request.get("/api/user/loginOut")
}